#include<iostream>
using namespace std;
unsigned int Fact(unsigned int n);

int main()
{
	/*********begin*********/
	const double PI=3.1416;
	int opt;
	double angle_du,angle,sin=0.0,cos=0.0;
	cin>>opt>>angle_du;
	angle_du=angle_du*PI/180.0;
	angle=angle_du;
	int i;
	if(opt==1)
	{
		for(i=1;i<10;i++)
		{
			sin+=angle/Fact(2*i-1);
			angle=angle*angle_du*angle_du*(-1);
			cout<<sin<<endl;
		}
		cout<<sin;
		return 0;
	}
	if(opt==2)
	{
		angle=1.0;
		for(i=0;i<10;i++)
		{
			cos+=angle/Fact(2*i);
			angle=angle*angle_du*angle_du*(-1);
		}
		cout<<cos;
		return 0;
	}

	return 0;
	/*********end*********/
}

unsigned int Fact(unsigned int n)
{
    unsigned int i;
    unsigned int result=1;
    for(i=2;i<=n;i++)
    {
        result*=i;
    }
    return result;
}
